package com.example.aboutwork.map;

import java.util.Map;
import java.util.concurrent.ConcurrentSkipListMap;

public class 可导航map {

    public static void main(String[] args) {
        ConcurrentSkipListMap<Long, String> skipListMap = new ConcurrentSkipListMap<>();

        for (long i = 0; i < 7; i++) {
            skipListMap.putIfAbsent(i,String.valueOf(i));
        }

        Map.Entry<Long, String> longStringEntry = skipListMap.floorEntry(8L);

        System.err.println(longStringEntry);


        System.err.println(skipListMap.lastEntry());

        System.err.println(skipListMap.ceilingKey(6L));

        System.err.println(skipListMap.navigableKeySet());

        System.err.println(skipListMap.headMap(4L));

        System.err.println(skipListMap.descendingMap());

        System.err.println(skipListMap.pollFirstEntry());

        System.err.println(skipListMap);


        System.err.println(skipListMap.higherEntry(3L));
        System.err.println(skipListMap.lowerEntry(3L));
        System.err.println(skipListMap.tailMap(3L));
    }

}
